package com.niit.covid.TopOne;


import com.niit.covid.bean.CovidBean;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

/**
 * @author:Ys
 * @date: 2022年08月12日 16:12
 * @desc:
 */
public class CovidTopOneReducer extends Reducer<CovidBean, NullWritable,CovidBean,NullWritable> {

    @Override
    protected void reduce(CovidBean key, Iterable<NullWritable> values, Context context) throws IOException, InterruptedException {
        //不遍历迭代器，此时key就是分组中的第一个key 也就是该州确诊病例数最多的县对应的数据
        context.write(key,NullWritable.get());
    }

}
